package _021_10_29

import (
	"fmt"
)

func _dfs(path []int, result *[][3]int, vArr []int, num []int) {
	if len(path) == 3 {
		var ret [3]int
		for i := 0; i < len(path); i++ {
			ret[i] = path[i]
		}
		*result = append(*result, ret)
		return
	}

	for i := 0; i < len(vArr); i++ {
		if vArr[i] != 1 {
			path = append(path, num[i])
			vArr[i] = 1
			_dfs(path, result, vArr, num)
			vArr[i] = 0
			path = path[0 : len(path)-1]
		}
	}
}

func threeSum(num []int) [][]int {
	var ret [][3]int
	//var path []int
	var vArr []int = make([]int, len(num))
	for i := 0; i < len(vArr); i++ {
		vArr[i] = 0
	}
	//_dfs(path, &ret, vArr, s)
	for i := 0; i < len(ret); i++ {
		fmt.Println(ret[i])
	}
	return [][]int{}
	// write code here
}
